var path = require('path')
function resolve (dir) {
  console.log(__dirname)
  return path.join(__dirname, dir)
}
module.exports = {
  devServer: {
    port: '10000'
  },
  chainWebpack: config => {
    config.resolve.alias.set('vue$', 'vue/dist/vue.common.js') // key,value自行定义，比如.set('@@', resolve('src/components'))
    config.resolve.alias.set('@', resolve('src'))
    config.resolve.alias.set('assets', resolve('src/assets'))
  },
  configureWebpack: config => {
    config.module.rules.push({
      test: /.md$/,
      use: [{
        loader: 'text-loader',
      }]
    })
  },
  css: {
    loaderOptions: {
      // pass options to sass-loader
      sass: {
        // @/ is an alias to src/
        // so this assumes you have a file named `src/variables.scss`
        // data: `@import "@/components/node_modules/shengya-ui/assets/stylesheets/mixins/_variables.scss";`
      },
      // postcss: {
      //   plugins: [
      //     require('postcss-pxtorem')({
      //       rootValue: 37.5, // 根大小750
      //       propList: ['*'], // 属性的选择器，*表示通用
      //       selectorBlackList: ['.px-'], //   忽略的选择器   .ig-  表示 .ig- 开头的都不会转换
      //     })
      //   ],
      //   /*
      //   ** You can extend webpack config here
      //   */
      //   extend(config, ctx) {
      //   }
      // }
    }
  }
}
